<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>
    <style>
        .error{color: red}
        .font{font-size: 200px}
        .success{color:green}
    </style>
    <div id="app">
       <li v-for="v in news">
           <span :class="v.status?'success':'error'">{{v.title}}</span>
           <button v-on:click="changeStatus(v,false)" v-if="v.status">删除</button>
           <button v-on:click="changeStatus(v,true)" v-if="!v.status">恢复</button>
       </li>
    </div>

<script>
    var app=new Vue({
        el:'#app',
        methods:{
            changeStatus:function (item,status) {
              item.status=status;
          }  
        },
        data:{
            news:[
                {title:'后端君',status:true},
                {title:'前端申',status:false}
            ]

        }
    });

</script>
</body>
</html>